package com.lry.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;

/**
 * 
 *
 * @author 李瑞益
 * @date 2019/8/20
 */
public class RoleSqlProvider {

    public String addRoles(@Param("roles")int[] roles,@Param("userId")Long userId){
        SQL sql = new SQL();
        sql.INSERT_INTO("role_user");
        for (int role : roles) {
            sql.VALUES("role_id",String.valueOf(role));
            sql.VALUES("user_id","#{userId,jdbcType=INTEGER}");
        }
        return sql.toString();
    }
}
